import { createRouter, createWebHistory } from "vue-router";
import { SystemRoutes } from '@/router/routes.js';
import { AuthRouteWhites } from './config'
import beforeMiddle from './beforeMiddle'

const routes = [...SystemRoutes]

const router = createRouter({
    history: createWebHistory(import.meta.env.VITE_PATH),
    routes,
})

// 前置守卫中间件
let beforeMd
{
  beforeMd = beforeMiddle.Default()
  beforeMd = beforeMiddle.Auth(beforeMd)
}

router.beforeEach(beforeMd)

export {
  AuthRouteWhites
}

export default router